/**@file

  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

Device(DWMI)
{
  // PNP0C14 is PNP ID assigned to WMI mapper
  Name(_HID, EISAID("PNP0C14"))
  Name(_UID, 0x0)

  Name(_WDG, Buffer(){
    // {44FADEB1-B204-40F2-8581-394BBDC1B651}
    // This user defined GUID for providing interfaces for WQ00/WS00
    0xb1, 0xde, 0xfa, 0x44, 0x04, 0xb2, 0xf2, 0x40, 0x85, 0x81, 0x39, 0x4b, 0xbd, 0xc1, 0xb6, 0x51,
    0x30, 0x30,   // Object Id (00), need to match WQ00/WS00 below.
    0x01,         // Instance Count
    0x01,         // Flags (WMIACPI_REGFLAG_EXPENSIVE)

    // {05901221-D566-11D1-B2F0-00A0C9062910}
    // This GUID for returning the MOF data, do not change
    0x21, 0x12, 0x90, 0x05, 0x66, 0xd5, 0xd1, 0x11, 0xb2, 0xf0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, //
    0x5A, 0x5A,   // Object ID (ZZ), need to match WQZZ below.
    0x01,         // Instance Count
    0x00          // Flags
  })

  Method(WQ00, 1)
  {
    Return (FWUC(0, 0))
  }

  Method(WS00, 2)
  {
    FWUC (1, Arg1)
  }

  Name(WQZZ, Buffer() {
    //
    // Embed BMF binary file generated from MOF file using:
    //   mofcomp  -B:test.bmf test.mof
    //
    // Below is the file content for test.mof:
    //
    //  #pragma namespace("\\\\.\\root\\wmi")
    //  #pragma classflags("forceupdate")
    //  #pragma autorecover
    //
    //  class WMIEvent : __ExtrinsicEvent
    //  {
    //  };
    //
    //  [WMI,
    //   Dynamic,
    //   Provider("WmiProv"),
    //   Locale("MS\\0x409"),
    //   Description("Class to write firmware command"),
    //   guid("{44FADEB1-B204-40F2-8581-394BBDC1B651}")
    //  ]
    //  class AcpiFirmwareCommunication
    //  {
    //      [key, read]
    //       string InstanceName;
    //      [read] boolean Active;
    //
    //      [WmiDataId(1),
    //       read, write,
    //       Description("description")
    //      ] uint32 Command;
    //  };
    //
    0x46, 0x4F, 0x4D, 0x42, 0x01, 0x00, 0x00, 0x00, 0x6B, 0x02, 0x00, 0x00, 0x14, 0x06, 0x00, 0x00,
    0x44, 0x53, 0x00, 0x01, 0x1A, 0x7D, 0xDA, 0x54, 0x18, 0xDA, 0x82, 0x00, 0x01, 0x06, 0x18, 0x42,
    0x10, 0x05, 0x10, 0x92, 0x46, 0x62, 0x02, 0x89, 0x80, 0x90, 0x18, 0x18, 0x14, 0x81, 0x85, 0x00,
    0x49, 0x02, 0x88, 0xC4, 0x41, 0xE1, 0x20, 0xD4, 0x9F, 0x40, 0x7E, 0x05, 0x20, 0x74, 0x28, 0x40,
    0xA6, 0x00, 0x83, 0x02, 0x9C, 0x22, 0x88, 0xA0, 0x57, 0x01, 0x36, 0x05, 0x98, 0x14, 0x60, 0x51,
    0x80, 0x76, 0x01, 0x96, 0x05, 0xE8, 0x16, 0x20, 0x1D, 0x96, 0x88, 0x04, 0x47, 0x89, 0x01, 0x47,
    0xE9, 0xC4, 0x16, 0x6E, 0xD8, 0xE0, 0x85, 0xA2, 0x68, 0x06, 0x51, 0x12, 0x94, 0x8B, 0x20, 0x5D,
    0x10, 0x52, 0x2E, 0xC0, 0x37, 0x82, 0x06, 0x10, 0xA5, 0x77, 0x01, 0xB6, 0x05, 0x98, 0x86, 0x27,
    0xD2, 0x20, 0xE4, 0x60, 0x08, 0x54, 0xCE, 0x80, 0x20, 0x69, 0x44, 0x21, 0x1E, 0xA7, 0x44, 0x08,
    0x0A, 0x84, 0x90, 0xD4, 0xF1, 0xA0, 0xA0, 0x71, 0x88, 0xAD, 0xCE, 0x46, 0x93, 0xA9, 0x74, 0x7E,
    0x48, 0x82, 0x70, 0xC6, 0x2A, 0x7E, 0x3A, 0x9A, 0xD0, 0xD9, 0x9C, 0x60, 0xE7, 0x18, 0x72, 0x3C,
    0x48, 0xF4, 0x20, 0x78, 0xA0, 0x55, 0x9B, 0x40, 0x11, 0x06, 0xAE, 0x08, 0x30, 0x28, 0x0D, 0x63,
    0xA1, 0x2E, 0x40, 0x29, 0xB0, 0x87, 0xCD, 0x06, 0x64, 0x88, 0x92, 0xE0, 0x50, 0x47, 0x00, 0x4B,
    0x14, 0x60, 0x7E, 0x1C, 0x32, 0x3C, 0x54, 0x32, 0x96, 0x90, 0x6C, 0xAC, 0x1E, 0x0A, 0x97, 0x02,
    0xA1, 0xB1, 0x9D, 0xB4, 0x67, 0x14, 0xB1, 0xE4, 0x29, 0x09, 0x26, 0x81, 0x47, 0x11, 0xD9, 0x68,
    0x1C, 0x1A, 0x3B, 0x0C, 0x0F, 0x33, 0xD8, 0x41, 0x1C, 0x46, 0xD9, 0xC8, 0x22, 0xF0, 0x84, 0x8E,
    0xF4, 0x21, 0xA0, 0x30, 0x01, 0xFF, 0xFF, 0x79, 0x46, 0x8D, 0xD1, 0x1C, 0x14, 0x11, 0x7D, 0x2E,
    0x40, 0x8F, 0x29, 0xEC, 0xD1, 0xC6, 0x3E, 0x5F, 0x0B, 0x1F, 0xAC, 0x30, 0x8E, 0xE0, 0xB8, 0x12,
    0x9C, 0xF9, 0x19, 0x9C, 0x42, 0xB4, 0x08, 0x05, 0x61, 0x09, 0x2A, 0xC6, 0x63, 0x41, 0x48, 0xC3,
    0x04, 0x0E, 0x53, 0x33, 0x8A, 0x70, 0xCE, 0x29, 0x54, 0xC8, 0x20, 0x91, 0x3C, 0x81, 0x90, 0x81,
    0x22, 0x04, 0x8A, 0x7F, 0x72, 0x09, 0xE2, 0x1F, 0x0A, 0x46, 0x06, 0x84, 0x3C, 0x0B, 0xB0, 0x3E,
    0x46, 0x42, 0x60, 0xF7, 0x83, 0x12, 0xC2, 0xF3, 0xC1, 0x1B, 0xC1, 0xF9, 0xBC, 0x0A, 0x54, 0x28,
    0xC0, 0x98, 0x00, 0x5B, 0x18, 0x52, 0x36, 0x32, 0x61, 0x45, 0x39, 0x36, 0xC3, 0xC5, 0x89, 0xF2,
    0x40, 0xD1, 0x1A, 0x84, 0xF0, 0xEC, 0x6C, 0x7E, 0x02, 0x0B, 0x19, 0x21, 0xF2, 0x69, 0x45, 0x0A,
    0x52, 0x1B, 0x9C, 0x40, 0xDA, 0x5F, 0x08, 0x7B, 0x39, 0xE8, 0x44, 0xE0, 0x48, 0xA3, 0x41, 0x1D,
    0x17, 0x7C, 0x2A, 0xF0, 0x89, 0xE0, 0x29, 0xC1, 0xB3, 0x3B, 0x2C, 0x8F, 0xEC, 0xD4, 0x9E, 0x28,
    0x1E, 0x07, 0x3C, 0x70, 0x76, 0x4F, 0xF0, 0x41, 0xC2, 0xE7, 0x03, 0xBC, 0x6B, 0x40, 0x5D, 0x0C,
    0x1E, 0x0B, 0xD8, 0x34, 0xC3, 0x61, 0x86, 0xE8, 0xB9, 0x7A, 0x02, 0x87, 0xC8, 0x00, 0x3D, 0xB6,
    0x27, 0x02, 0xEC, 0xBC, 0x4E, 0xE6, 0x71, 0xE0, 0x8D, 0xA2, 0xD9, 0xBB, 0x04, 0x21, 0x38, 0x1E,
    0x5F, 0x23, 0xD8, 0x84, 0x13, 0x58, 0xFE, 0x20, 0x50, 0x23, 0x33, 0xB4, 0x87, 0x7C, 0x5A, 0xAF,
    0x03, 0x3E, 0x4D, 0x98, 0xC0, 0x62, 0x4F, 0x26, 0x74, 0x3C, 0xE0, 0x57, 0x7C, 0x0A, 0x21, 0x57,
    0x82, 0xFF, 0x7F, 0x6C, 0x9F, 0x12, 0x2C, 0xE1, 0x6C, 0x21, 0x27, 0xE3, 0x41, 0x43, 0x3F, 0x1E,
    0x60, 0x03, 0x43, 0xE8, 0xEB, 0x22, 0x01, 0xA2, 0xCE, 0x23, 0xA8, 0x43, 0x85, 0xCF, 0x13, 0xEC,
    0x3E, 0x10, 0xF4, 0x19, 0xC0, 0x43, 0x09, 0xEB, 0xDF, 0x8B, 0x47, 0x06, 0x1F, 0x10, 0x7F, 0x83,
    0xC0, 0x00, 0xB2, 0xD3, 0x89, 0x0F, 0x15, 0xE0, 0xB8, 0x71, 0x18, 0x0C, 0xCE, 0x88, 0xE1, 0xDF,
    0x26, 0x7C, 0x44, 0xF1, 0x05, 0xE2, 0x25, 0xE2, 0x39, 0x80, 0x9F, 0x72, 0xE0, 0x1F, 0x0A, 0x3C,
    0x92, 0xE0, 0x6F, 0x14, 0x6F, 0x1A, 0xD8, 0xB1, 0xF3, 0x51, 0x9C, 0xC4, 0xEB, 0x89, 0xC7, 0xEC,
    0x21, 0xF1, 0xD3, 0x0E, 0x70, 0x1F, 0x0E, 0x57, 0x68, 0xD3, 0xA7, 0x46, 0xA3, 0x56, 0x0D, 0xCA,
    0xD4, 0x28, 0xD3, 0xA0, 0x56, 0x9F, 0x4A, 0x8D, 0x19, 0x1B, 0x82, 0xE5, 0x52, 0xE8, 0xFF, 0x0F,
    0xE2, 0xB0, 0x20, 0x34, 0xEE, 0xF1, 0x46, 0x20, 0xFE, 0xFF, 0x03
  })
}
